package cn.topkinson.es.etl.entity.es;

import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.sort.SortOrder;

import java.util.Map;

public class SearchDto {

    private IndexEnum indexEnum;
    private QueryBuilder queryBuilder;

    private Integer from;
    private Integer size;

    private String[] includes;
    private String[] excludes;

    private Map<String, SortOrder> sortOrderMap;

    public SearchDto() {
    }

    public SearchDto(IndexEnum indexEnum) {
        this.indexEnum = indexEnum;
    }

    public SearchDto(IndexEnum indexEnum, QueryBuilder queryBuilder) {
        this.indexEnum = indexEnum;
        this.queryBuilder = queryBuilder;
    }

    public SearchDto(IndexEnum indexEnum, QueryBuilder queryBuilder, Integer from, Integer size) {
        this.indexEnum = indexEnum;
        this.queryBuilder = queryBuilder;
        this.from = from;
        this.size = size;
    }

    public SearchDto(IndexEnum indexEnum, QueryBuilder queryBuilder, String[] includes, String[] excludes) {
        this.indexEnum = indexEnum;
        this.queryBuilder = queryBuilder;
        this.includes = includes;
        this.excludes = excludes;
    }

    public SearchDto(IndexEnum indexEnum, QueryBuilder queryBuilder, Integer from, Integer size, String[] includes, String[] excludes) {
        this.indexEnum = indexEnum;
        this.queryBuilder = queryBuilder;
        this.from = from;
        this.size = size;
        this.includes = includes;
        this.excludes = excludes;
    }

    public SearchDto(IndexEnum indexEnum, QueryBuilder queryBuilder, Integer from, Integer size, String[] includes, String[] excludes, Map<String, SortOrder> sortOrderMap) {
        this.indexEnum = indexEnum;
        this.queryBuilder = queryBuilder;
        this.from = from;
        this.size = size;
        this.includes = includes;
        this.excludes = excludes;
        this.sortOrderMap = sortOrderMap;
    }

    public IndexEnum getIndexEnum() {
        return indexEnum;
    }

    public void setIndexEnum(IndexEnum indexEnum) {
        this.indexEnum = indexEnum;
    }

    public QueryBuilder getQueryBuilder() {
        return queryBuilder;
    }

    public void setQueryBuilder(QueryBuilder queryBuilder) {
        this.queryBuilder = queryBuilder;
    }

    public Integer getFrom() {
        return from;
    }

    public void setFrom(Integer from) {
        this.from = from;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public String[] getIncludes() {
        return includes;
    }

    public void setIncludes(String[] includes) {
        this.includes = includes;
    }

    public String[] getExcludes() {
        return excludes;
    }

    public void setExcludes(String[] excludes) {
        this.excludes = excludes;
    }

    public Map<String, SortOrder> getSortOrderMap() {
        return sortOrderMap;
    }

    public void setSortOrderMap(Map<String, SortOrder> sortOrderMap) {
        this.sortOrderMap = sortOrderMap;
    }
}
